package com.example.parallelTemplate.commons.service.impl;

import com.example.parallelTemplate.commons.dto.BannerDTO;
import com.example.parallelTemplate.commons.param.BannerParam;
import com.example.parallelTemplate.commons.req.AppInfoReq;
import com.example.parallelTemplate.commons.service.IBannerService;
import org.springframework.stereotype.Service;

@Service
public class BannerServiceImpl implements IBannerService {

    @Override
    public BannerDTO queryBannerInfo(BannerParam bannerParam) {
        long beginTime = System.currentTimeMillis();
        try {
            System.out.println("开始查询banner信息" + beginTime);
            Thread.sleep(100);//模拟调用耗时100ms
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println("结束查询banner信息,耗时：" + (System.currentTimeMillis() - beginTime));
        return new BannerDTO("捡田螺的小男孩");
    }

    @Override
    public BannerParam buildBannerParam(AppInfoReq req) {
        return new BannerParam();
    }
}
